package com.cnhis.cloudhealth.clinical.clidoctor.clinicalreceptiontransfer.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.cnhis.cloudhealth.commons.dao.BaseDao;
import com.cnhis.cloudhealth.commons.utils.Page;

@Repository
public class ClinicalReceptionDao extends BaseDao {
	public void waitingToReception(Map map) throws Exception {
		this.update("ClinicalReception.waitingToReception", map);
	}

	public void finishedReception(Map map) throws Exception {
		this.update("ClinicalReception.finishedReception", map);
	}

	public void cancelReception(Map map) throws Exception {
		this.update("ClinicalReception.cancelReception", map);
	}

	public Map receptionOrQuit(Map map) throws Exception {
		return (Map) this.queryToObject("ClinicalReception.receptionOrQuit",
				map);
	}

	public void updateClinicalReception(Map map) throws Exception {
		this.update("ClinicalReception.updateClinicalReception", map);
	}

	public Page selectClinicalOffice(Map map, int currPage, int pageSize)
			throws Exception {
		return this.queryForPage("ClinicalReception.selectClinicalOffice", map, currPage, pageSize);

	}

	public Page hasSettleDoctorAdvice(Map map,int currPage,int pageSize) throws Exception {
		return this.queryForPage("ClinicalReception.hasSettleDoctorAdvice", map, currPage, pageSize);
	}

	public Map visittimeWhetherValidity(Map map) throws Exception {
		return (Map) this.queryToObject(
				"ClinicalReception.visittimeWhetherValidity", map);
	}

	public Page personalFinishedPatient(Map map, int currPage, int pageSize)
			throws Exception {
		return this.queryForPage("ClinicalReception.personalFinishedPatient",
				map, currPage, pageSize,
				"ClinicalReception.personalFinishedPatientCount");
	}
    public List queryConsultingRoomByAdministrativeOffice(Map map)throws Exception{
    	return this.queryForList("ClinicalReception.queryConsultingRoomByAdministrativeOffice", map);
    	
    	
	 }
    public List queryDoctorByAdministrativeOffice(Map map)throws Exception{
		 return this.queryForList(
					"ClinicalReception.queryDoctorByAdministrativeOffice", map);
	 }
     //已取消接诊或已接诊完成
    public int existsReception(Map map)throws Exception{
  		 return (int) queryForExtObject("ClinicalReception.existsReception", map);
  	 }
  	 //已下达有医嘱
    public int existsAdvice(Map map)throws Exception{
    	 return (int) queryForExtObject("ClinicalReception.existsAdvice", map);
  	 }
       //挂号记录已接诊或已退号
    public int existsExit(Map map)throws Exception{
    	 return (int) queryForExtObject("ClinicalReception.existsExit", map);
  	 }
    public Long getBCE01D(Map map)throws Exception{
    	return (Long) queryForExtObject("ClinicalReception.getBCE01D", map);
    }
    
    public Long getBCK01C(Map map)throws Exception{
      return 	(Long) queryForExtObject("ClinicalReception.getBCK01C", map);
    }
    
    public Long getBCB01(Map map)throws Exception{
    	return 	(Long) queryForExtObject("ClinicalReception.getBCB01", map);
    }
    public int existsBCK01C(Map map)throws Exception{
    	return 	(int) queryForExtObject("ClinicalReception.existsBCK01C", map);
    }
    public void updateVAA1(Map map)throws Exception{
    	update("ClinicalReception.updateVAA1", map);
    }
    public void updateVAC1(Map map)throws Exception{
    	update("ClinicalReception.updateVAC1", map);
    }
    public void updateBCZ1(Map map)throws Exception{
    	update("ClinicalReception.updateBCZ1", map);
    }
    public void updateVAD1(Map map)throws Exception{
    	update("ClinicalReception.updateVAD1", map);
    }
    public void updateVAJ1(Map map)throws Exception{
    	update("ClinicalReception.updateVAJ1", map);
    }
    public int existsVAJ1(Map map)throws Exception{
    	return 	(int) queryForExtObject("ClinicalReception.existsVAJ1", map);
    }
    public void saveVAJ1(Map map)throws Exception{
    	insert("ClinicalReception.saveVAJ1", map);
    }
    
    public void cancelVAA(Map map)throws Exception{
    	update("ClinicalReception.cancelVAA", map);
    }
    public int existsVAC1(Map map)throws Exception{
    	return (int) queryForExtObject("ClinicalReception.existsVAC1", map);
    }
    public void saveZAE1(Map map)throws Exception{
    	insert("ClinicalReception.saveZAE1", map);
    }
    public void updateParams(Map map)throws Exception{
    	update("ClinicalReception.updateParams", map);
    }
}
